#define _CRT_SECURE_NO_WARNINGS 1


#include<string>
#include<iostream>

using namespace std;

int main()
{
	int n = 0;
	string s;
	cin >> n >> s;
	int left = 1, right = n, mid = 0;
	for (int i = 0; i < s.size(); i++)
	{
		mid = (left + right) / 2;
		if (s[i] == 'u')
		{
			left = mid + 1;
		}
		else if (s[i] == 'd')
		{
			right = mid - 1;
		}
		else if(s[i] == 'y')
		{
			cout << mid << endl;
			return 0;
		}
	}

	return 0;
}